<?php 
	//----------------------------------------------
	//               项目首页页面
	//----------------------------------------------
	
	//加载MySQL数据库连接配置页面
	include "conn.inc.php";

	//如果没有登陆就去登陆页面
	if(!isset($_SESSION['islogin']) && $_SESSION['islogin'] == 1){
		header("Location:login.php");
	}

	echo "你好".$_SESSION['username'].'<a href="logout.php">推出</a><br>';


	//查看权限
	if($_SESSION['allow_1'] == 1){
		echo "你有SVIP特权。<br>";
	}
	if($_SESSION['allow_2'] == 1){
		echo "你有VIP特权。<br>";
	}
	if($_SESSION['allow_3'] == 1){
		echo "你是普通用户。<br>";
	}


	//查看邮件数目
	$sql1 = "select id, title, ptime from email where uid = ?";
	$stmt = $pdo->prepare($sql1);
	$stmt->execute(array($_SESSION['id']));

	echo "你有".$stmt->rowCount()."封邮件。";

	//查看邮件
	echo '<table align="center" border="0px">';
			echo '<tr>';
				echo '<th>ID</th><th>文章</th><th>时间</th>';
			echo '</tr>';
		while (list($id, $title, $ptime) = $stmt->fetch(PDO::FETCH_NUM)) {
			echo '<tr>';
				echo '<td>'.$id.'</td>';
				echo '<td>'.$title.'</td>';
				echo '<td>'.$ptime.'</td>';
			echo '</tr>';
		}
	echo '</table>';




 ?>